<template>
    <div class="container">
        <div class="title">{{getData.title}}</div>
        <!-- <div class="title_time">日期</div> -->
        <!-- <div class="center_img" v-if="getData.imgUrl!=''">
            <img :src="getData.imgUrl" alt="" @click="clickImg($event)">

            <big-img v-if="showImg" @clickit="viewImg" :imgSrc="imgSrc"></big-img>
        </div> -->
        <div class="text" @click="imgs"></div>
        <big-img v-if="showImg" @clickit="viewImg" :imgSrc="imgSrc"></big-img>
    </div>
</template>
<script>
import $ from 'jquery'
import BigImg from '@/components/BigImg.vue';
export default {
    name:'Information_Details',
    components: {
        'big-img':BigImg
    },
    data(){
        return{
            showImg:false,
            imgSrc: '',
            getData:{}
        }
    },
    mounted() { 
        this.get_datas()
    },
    updated() {
        $('img').css({
			'display':'inline-block',
			'width':'100%',
			'float':'left',
			'padding':'0 10px 0 0',
			'box-sizing':'border-box'
        })
    },
    methods: {
        imgs(e){
            alert(e.target)
            alert(e.target.src)
            if(e.target.src!=undefined){
                this.showImg = true;
                // 获取当前图片地址
                this.imgSrc = e.target.src;
            }
        },
        viewImg(){
            this.showImg = false;
        },
        get_datas(){
            let that=this
            this.$axios({
                url:"https://yl.payree.com/api/app/noauth/rest/query/activityDetail?id="+localStorage.getItem('ids'),
                // url:that.HOST1,
                // url:this.Get_data_Host,
                method: 'get',
            })
            .then(res=>{
                // console.log(res)
                this.getData=res.data.result
                $('.text').html(res.data.result.content)
            })
            .catch(error=>{
                alert('服务器出错！')
            })
        }
    }
}
</script>
<style scoped lang="less">
.container{
    width: 100%;
    .title{
        width: 100%;
        height: 84px;
        margin-top: 10px;
        font-size: 30px;
        color:#384357;
        font-family: PingFangSC-Medium;
        line-height: 42px;
        font-weight: 600;
        padding: 0 20px;
        box-sizing: border-box;
        text-align: center;
    }
    .title_time{
        width: 100%;
        height: 17px;
        line-height: 17px;
        margin-top: 8px;
        font-size: 12px;
        color:#999999;
        font-family: PingFangSC-Regular;
    } 
    .center_img{
        width: 100%;
        height: 180px;
        margin-top: 48px;
        padding: 0 20px;
        box-sizing: border-box;
    }
    .center_img>img{
        display: inline-block;
        width: 100%;
        height: 100%;
    }
    .text{
        width: 100%;
        padding-left: 20px;
        padding-right: 10px;
        box-sizing: border-box;
    }
}  
</style>